<%@ page language="java" contentType="text/html; charset=UTF-8"  pageEncoding="UTF-8"%>
<!DOCTYPE HTML>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>添加和修改角色</title>
	<%@ include file="/view/common/tags.jsp"%>
</head>
<body>
	<div class="well well_p" >
		<sk:form method="post" cssClass="form-horizontal" action="${sysManagerV1}/role/saveRole" id="saveAndUpdateFrom" target="_parent"  >
			<div class="form-group">
				<label class="col-xs-3 text-right">角色名称:</label>
				<div class="col-xs-5">
					<input type="text" class="form-control" name="roleName" id="roleName" value="${roleEdit.roleName }" placeholder="输入角色名称">
					<input type="hidden" id="rowId" name="rowId" value="${roleEdit.rowId }">
				</div>
			</div>
				<div class="form-group">
				<label class="col-xs-3 text-right">角色类型:</label>
				<div class="col-xs-5"">
					 <sk:select cssClass="form-control" name="roleType" value="${roleEdit.roleType }" id="roleType" >
						<sk:options options="${roleTypeList}"/>
					</sk:select> 
				</div>
			</div>
			<div class="form-group">
				<label class="col-xs-3 text-right">角色描述:</label>
				<div class="col-xs-7">
					<textarea  class="remark" name="roleRemark" id="roleRemark" placeholder="输入角色描述">${roleEdit.roleRemark }</textarea>
				</div>
			</div>
			<input type="hidden" id="isReCommit" value="0">
		</sk:form>
	</div>
</body>
   <%@ include file="/view/common/footer.jsp"%>
   <script type="text/javascript">
   function add(){
	    var id = $('#rowId').val()
	    var name = $('#roleName').val()
	    var remark = $('#roleRemark').val()
	    var roleType = $("#roleType").val();
	    if (name == null || name == '') {
	        layer.msg(err[i]+"失败,角色名称不能为空!");
	        return;
	    }
	    if (roleType == null || roleType == '') {
	        layer.msg(err[i]+"失败,角色类型不能为空!");
	        return;
	    }
	    if (remark == null || remark == '') {
	        layer.msg(err[i]+"失败,角色描述不能为空!");
	        return;
	    }       
	    if ($("#isReCommit").val() == 0) {
	        $("#isReCommit").val(1);
	        $("#saveAndUpdateFrom").submit();
	    }
	}
   </script>
</html>